{php include wl_template('common/header');}
<ul class="nav nav-tabs">
	<li><a href="{php echo web_url('ranklist/rank/rank_list');}">排行榜</a></li>
	<li class="active"><a href="{php echo web_url('ranklist/rank/rank_edit');}">编辑排行榜</a></li>
</ul>
<div class="app-content">
	<div class="app-form">
		<form class="form-horizontal form form-validate" action="" method="post" id="form1">
			<div class="panel panel-default">
				<div class="panel-heading">排行榜</div>
				<div class="panel-body">
					<div class="form-group">
						<label class="col-sm-2 control-label">排行榜名称</label>
						<div class="col-sm-9">
							<input type="text" class="form-control" placeholder="请输入排行榜名称" name="name" value="{$rank['name']}" />
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-2 control-label">数据类型</label>
						<div class="col-sm-9">
							<label class="radio-inline" onclick="$('.usersort').show();$('.storesort').hide();"><input type="radio" name="type" value="0" {if $rank['type'] != 1} checked {/if}>用户</label>
							<label class="radio-inline" onclick="$('.usersort').hide();$('.storesort').show();"><input type="radio" name="type" value="1" {if $rank['type'] == 1} checked {/if}>商户</label>
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-2 control-label">排序方式</label>
						<div class="col-sm-9">
							<div class="usersort" {if $rank['type'] == 1}style="display: none;"{/if}>
								<label class="radio-inline"><input type="radio" name="orderby" value="0" {if $rank['orderby'] == 0} checked {/if}>用户积分</label>
								<label class="radio-inline"><input type="radio" name="orderby" value="1" {if $rank['orderby'] == 1} checked {/if}>用户余额</label>
								<label class="radio-inline"><input type="radio" name="orderby" value="2" {if $rank['orderby'] == 2} checked {/if}>用户消费金额</label>
							</div>
							<div class="storesort" {if $rank['type'] != 1}style="display: none;"{/if}>
								<label class="radio-inline"><input type="radio" name="orderby" value="11" {if $rank['orderby'] == 11} checked {/if}>商户人气</label>
								<label class="radio-inline"><input type="radio" name="orderby" value="12" {if $rank['orderby'] == 12} checked {/if}>商户订单数</label>
								<label class="radio-inline"><input type="radio" name="orderby" value="13" {if $rank['orderby'] == 13} checked {/if}>商户营业额</label>
							</div>
                        </div>
                    </div>
					<!--<div class="form-group">
						<label class="col-sm-2 control-label">背景图</label>
						<div class="col-sm-9">
							{php echo tpl_form_field_image('bgimg', $rank['bgimg'])}
							<span class="help-block">建议图片大小900*500</span>
						</div>
					</div>-->
                    <div class="form-group">
                        <label class="col-sm-2 control-label">显示数量</label>
                        <div class="col-sm-9">
                            <input type="text" class="form-control" placeholder="请输入排行榜显示数量 默认10" name="number" value="{$rank['number']}" />
                        </div>
                    </div>
					<div class="form-group">
						<label class="col-sm-2 control-label">状态</label>
						<div class="col-sm-9">
							<input type="checkbox" class="js-switch" name="status" {if $rank['status'] == 1} checked="checked" {/if}>
						</div>
					</div>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label"></label>
				<div class="col-sm-9">
					<button type="submit" class="btn btn-primary min-width" name="submit" value="提交">提交</button>
					<input type="hidden" name="token" value="{$_W['token']}" />
				</div>
			</div>
		</form>
	</div>
</div>
{php include wl_template('common/footer');}